home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / cli / NanoCLS-src.lha / NanoCLS.ASM
Assembly Source File  |  2002-10-19  |  1KB  |  33 lines

  1. ; FILE: Source:NanoCLS.ASM        REV: 1 --- Absolutely the shortest CLS program (48 bytes)
  2. ; History
  3. ;  0      Initial version.
  4. ;  1      Added 'The Story'.
  5. ;
  6.  
  7. ; The Story
  8. ; ---------
  9. ;
  10. ; Once upon a time there was a silly competition in aminet about the
  11. ; shortest CLS (Clear Screen) program possible. For some reason I missed
  12. ; this competition altogether until now (March 2001). Anyway here is
  13. ; something I wrote 5-6 years ago, while I was playing with BCPL & GlobVec
  14. ; of the dos.library. This is (and no, there is absolutely NO WAY of
  15. ; getting this ANY shorter!) the shortest possible amiga executable
  16. ; program clearing the shell window.
  17. ;
  18. ; Also as a bonus, as opposed to many other competition entries in aminet,
  19. ; this routine is 100% OS friendly, and doesn't rely on any dirty tricks,
  20. ; like traversing library list (like Dag Agren's CircLeS for example).
  21. ;
  22. ; End of story. Feel free to prove me wrong though. :-)
  23. ;
  24. ;   - Harry "Piru" Sintonen <sintonen@iki.fi>
  25. ;
  26. Main    move.l    $E0(a2),a4    ; ptr to wrch routine, d1.b is char to write
  27.     moveq    #12,d1        ; FORM FEED
  28.     moveq    #3*4,d0        ; BCPL stack displacement
  29.     jmp    (a5)        ; call BCPL routine in a4 & return
  30.  
  31.     ; We even have two spare bytes here, since above isn't
  32.     ; multiple of 4. Oh well... ;)
  33.